package pub.cleangao.memm.transport.netty.compress;

import java.util.HashMap;
import java.util.Map;

public class CompressSupplier {

    private static final Map<String, Compress> COMPRESS_MAP = new HashMap<>();

    static {
        GzipCompress gzipCompress = new GzipCompress();
        COMPRESS_MAP.put(gzipCompress.type(), gzipCompress);
        SnappyCompress snappyCompress = new SnappyCompress();
        COMPRESS_MAP.put(snappyCompress.type(), snappyCompress);
    }

    public static Compress getByType(String type) {
        return COMPRESS_MAP.get(type);
    }

}
